<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
	<head>
		<base href="<%=basePath%>">
		<title>资源列表</title>
		
		<link rel="stylesheet" type="text/css" href="pages/system/resource/css/resources.css">
		<script type="text/javascript" src="pages/system/resource/js/resources.js"></script>
	</head>
	<body>
		<div class="row">
	        <div class="col-xs-12">
	            <div class="card">
	                <div class="card-header">
	                    <div class="card-title">
	                    	<div class="title">资源列表</div>
	                    </div>
	                </div>
	                <div class="card-body">
	                    <table id="resourcesTable" class="datatable table table-striped" cellspacing="0" width="100%">
	                        
	                    </table>
	                </div>
	            </div>
	        </div>
	    </div>
	    
	    <!-- 修改资源信息 -->
		<div id="resource-modal" class="modal fade" tabindex="-1" role="dialog"
			aria-labelledby="myModalLabel">
			<div class="modal-dialog modal-lg" role="document">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"
							aria-label="Close">
							<span aria-hidden="true">&times;</span>
						</button>
						<h4 class="modal-title" id="myModalLabel">修改资源信息</h4>
					</div>
					<div class="modal-body">
						
						<form id="resource-form" class="form-horizontal">
						
						  <div class="form-group">
						    <label for="resourceName" class="col-md-2 control-label">文件名</label>
						    <div class="col-md-6">
						      <input type="hidden" class="info-input" id="resourceId" name="resourceId" />
						      <input type="text" class="form-control info-input" id="resourceName" name="resourceName" placeholder="请输入带后缀名的全名" >
						    </div>
						    <label id="resourceName-label" class="col-md-4 info-label"></label>
						  </div>
	                      <div class="form-group" id="pathFormGroup">
	                        <label for="path" class="col-sm-2 control-label">资源地址</label>
	                        <div class="col-sm-6">
						      	<input type="hidden" class="info-input" id="type" name="type" />
	                            <input type="text" class="form-control info-input" id="path" name="path" placeholder="请输入资源地址" />
	                        </div>
						    <label id="path-label" class="col-md-4 info-label"></label>
	                      </div>
						  <div class="form-group">
	                      	<label for="introduction" class="col-sm-2 control-label">资源介绍</label>
	                      	<div class="col-sm-6">
	                            <textarea class="form-control info-input" rows="5" id="introduction" name="introduction" placeholder="请输入资源介绍，不少于20字，不超过255字。" ></textarea>
	                        </div>
						    <label id="introduction-label" class="col-md-4 info-label"></label>
	                      </div>
	                      <div class="form-group">
	                        <label for="words" class="col-sm-2 control-label">关键词</label>
	                        <div class="col-sm-6 searchWordsGroup">
	                            <input type="text" class="form-control info-input" id="words" name="words" placeholder="请输入查询关键词，多个关键词以分号(;)隔开。" />
	                        	<div v-if="result!=null && result.length>0">
	                        		<button type="button" class="btn btn-info btn-sm" v-for="label in result" @click="clickBtn(label.label)">{{label.label}}</button>
	                        	</div>
	                        </div>
						    <label id="words-label" class="col-md-4 info-label"></label>
	                      </div>
						  <div class="form-group">
		                        <label for="maxNum" class="col-sm-2 control-label">阅后即焚次数</label>
		                        <div class="col-sm-6">
		                            <input type="number" maxlength="10" class="form-control" id="maxNum" name="maxNum" placeholder="请输入最多允许下载或阅读次数，达到次数后自动删除资源文件" />
		                        </div>
						    	<label id="maxNum-label" class="col-md-4 info-label"><code></code></label>
		                    </div>
						</form>
						
						
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
						<button id="resource-save-btn" type="button" class="btn btn-primary">提交</button>
					</div>
				</div>
			</div>
		</div>
		
	</body>
</html>